home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3938 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: news.bridge.net!news
  2. From: David Byrden <100101.2547@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Copy constructing an already default constructed object
  5. Date: 26 Jan 1996 20:45:39 GMT
  6. Organization: self-employed
  7. Message-ID: <4ebehj$5i7@news.bridge.net>
  8. References: <4e906b$stk@elaine32.Stanford.EDU> <4eal0n$hgq@dawn.mmm.com> <3108ef14.340699@nntp>
  9. NNTP-Posting-Host: ppp-mia1-65.bridge.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  14.  
  15.  
  16. >>  A::operator =(const A& other)
  17. >>  {
  18. >>    b0 = other.b0 ;
  19. >>    b1 = other.b1;
  20. >>  }
  21.  
  22. >> To me this seems like a major pain in the butt.
  23.  
  24. That's precisely why the compiler will automatically generate a public 
  25. assignment operator with this behaviour, if you don't bother to write 
  26. one.
  27.  
  28.  
  29. >>  Do you have to overload = for all the contained operators too?
  30.  
  31. >>  All I really want to do is have the copy constructor invoked on the 
  32. >> piece that piece of memory.  Why can't this be done?
  33.  
  34. Brien, I genuinely cannot understand what you are trying to say in these 
  35. two sentences. Sloppy English, like C++, can be a "major pain the the 
  36. butt".
  37.  
  38.                     David
  39.  
  40.  
  41.